package com.dede.applib.extends

import android.graphics.drawable.Drawable
import android.support.annotation.ColorRes
import android.support.annotation.DrawableRes
import android.support.v4.content.ContextCompat
import android.view.View

/**
 * @author hsh
 * @date 2017/9/21 13:54.
 * @doc
 */

fun View.color(@ColorRes id: Int): Int = ContextCompat.getColor(this.context, id)

fun View.drawable(@DrawableRes id: Int): Drawable = ContextCompat.getDrawable(this.context, id)